package com.wuzuqing.android.eightdiagrams.model

/**
 * @CopyRight: 广州仰望星空云科技有限公司
 * @Author : wuzuqing
 * @Email:wuzuqing@xinyu668.com
 * @CreateTime: 7.12.23 3:10 PM
 * @Description: 请写描述
 */
class MeasureParams(
    val type: MeasureType,
    val topNumber: Int = 0,
    val bottomNumber: Int = 0,
    val yaoIndex: Int = 0,
    val text: String = "",
    var isHistory:Boolean = false
) {
    companion object {
        fun number(topNumber: Int, bottomNumber: Int, isCheck: Boolean = false): MeasureParams {
            val type = when (isCheck) {
                true -> MeasureType.NUMBER_AND_TIME
                false -> MeasureType.NUMBER
            }
            return MeasureParams(type, topNumber = topNumber, bottomNumber = bottomNumber)
        }

        fun text(text: String): MeasureParams {
            return MeasureParams(MeasureType.TEXT, text = text)
        }

        fun time(): MeasureParams {
            return MeasureParams(MeasureType.TIME)
        }

        fun select(topIndex:Int,bottomIndex:Int,yaoIndex: Int): MeasureParams {
            return MeasureParams(MeasureType.SELECT, topNumber = topIndex, bottomNumber = bottomIndex, yaoIndex = yaoIndex)
        }
    }
}